<?php
	global $Puzzle;
	
	$p = $this->getParameter('page_number');
	$ds = $this->getParameter('data_structure');
	$pv = $this->getParameter('page_variable');
	
	
	// Generar links para cada pagina
	
	$links = array();
	
	$curl = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
		
	$param_names = array_keys($_GET);
	
	for ($i = 1; $i <= count($ds->ds['pds']); $i++)
	{
		$params = "";
		
		foreach ($param_names as $parameter)
		{
			if ($parameter != $pv)
			{
				if ($params == "")
					$params = "?" . $parameter . "=";
				else
					$params = $params . '&' . $parameter . "=";
			
				$params = $params . $_GET[$parameter];
			}
		}
		
		if ($params == "")
			$params = "?" . $pv . "=";
		else
			$params = $params . '&'. $pv . "=";
		
		$params = $params . $i;
		
		
		$links[$i] = $curl . $params;
	}
	
	// Asignar variables de clase
	
	$this->page_number = $p;
	$this->data_structure = $ds;
	$this->links = $links;
	
?>
